Skip to content

DOC-3391: Add addButton and addCommand example to creating-a-plugin#4055

Merged
kemister85 merged 2 commits intofeature/8/DOC-3387from
feature/8/DOC-3387_DOC-3391
Apr 13, 2026
Merged

DOC-3391: Add addButton and addCommand example to creating-a-plugin#4055
kemister85 merged 2 commits intofeature/8/DOC-3387from
feature/8/DOC-3387_DOC-3391

Conversation

@kemister85
Copy link
Copy Markdown
Contributor

Summary

  • Adds "Adding a toolbar button to a custom plugin" section to creating-a-plugin.adoc
  • Shows PluginManager.add, editor.addCommand, editor.ui.registry.addButton, and editor.execCommand
  • Shows how to wire plugin + toolbar in tinymce.init
  • Addresses Context7 benchmark Q9 (score 15/100)

Source validation

  • PluginManager.add confirmed at PluginManager.ts / AddOnManager.ts
  • editor.addCommand confirmed at EditorCommands.ts / Editor.ts
  • editor.ui.registry.addButton confirmed at Registry.ts
  • editor.execCommand confirmed at Editor.ts

Test plan

  • All 4 API methods verified against tinymce source
  • Plugin registration pattern matches existing boilerplate example
  • external_plugins usage matches existing docs pattern
  • Antora build passes with no errors

Add toolbar button section showing PluginManager.add with
editor.ui.registry.addButton and editor.addCommand to address
Context7 benchmark Q9 (15/100).
@kemister85 kemister85 requested review from a team and soritaheng as code owners April 13, 2026 02:20
@kemister85 kemister85 requested review from EkimChau, ShiridiGandham and tiny-james and removed request for a team April 13, 2026 02:20
Co-authored-by: Millie <millie.macdonald@tiny.cloud>
@kemister85 kemister85 merged commit 66b19d7 into feature/8/DOC-3387 Apr 13, 2026
5 checks passed
@kemister85 kemister85 deleted the feature/8/DOC-3387_DOC-3391 branch April 13, 2026 23:06
kemister85 added a commit that referenced this pull request Apr 13, 2026
* DOC-3388: Add getContent and setContent examples to save-content partial (#4052)

Add programmatic get/set content section with runnable examples
using editor.getContent(), getContent({ format: 'text' }), and
editor.setContent() to address Context7 benchmark Q3 (12/100).

* DOC-3389: Strengthen add-css-options page for custom content CSS (#4053)

Update description and add keywords for content_css and content_style.
Add intro paragraph explaining the two options to address Context7
benchmark Q8 (0/100).

* DOC-3390: Add editor.on('change') example to events page (#4054)

Add content change callback example using setup option and
editor.on('change') to address Context7 benchmark Q4 (30/100).

* DOC-3391: Add addButton and addCommand example to creating-a-plugin (#4055)

* DOC-3391: Add addButton and addCommand example to creating-a-plugin

Add toolbar button section showing PluginManager.add with
editor.ui.registry.addButton and editor.addCommand to address
Context7 benchmark Q9 (15/100).

* Update modules/ROOT/pages/creating-a-plugin.adoc

Co-authored-by: Millie <millie.macdonald@tiny.cloud>

---------

Co-authored-by: Millie <millie.macdonald@tiny.cloud>

* DOC-3392: Add programmatic mode.set example to readonly docs (#4056)

Add example showing editor.mode.set('readonly') and
editor.mode.set('design') for runtime mode switching to address
Context7 benchmark Q7 (25/100).

* DOC-3393: Add plugins and toolbar multi-plugin example to quickstart (#4057)

Add "Configure plugins and toolbar" section with plugins: 'image code'
and toolbar example to the quickstart partial to address Context7
benchmark Q2 (56/100).

* DOC-3394: Add content filtering intro to content-filtering page (#4058)

Update description and keywords to mention valid_elements,
invalid_elements, extended_valid_elements. Add intro paragraph
summarizing key filtering options to address Context7 benchmark
Q10 (22/100).

* DOC-3395: Improve quickstart keywords for selector/ID discoverability (#4059)

Add selector, textarea, id, tinymce.init keywords to all quickstart
pages (cloud, npm, php, .net, zip) to address Context7 benchmark
Q1 (62/100).

* DOC-3396: Improve custom-toolbarbuttons and file-image-upload metadata (#4060)

Update description and keywords for custom-toolbarbuttons (addButton,
custom button), file-image-upload (images_upload_handler), and
upload-images pages to address Context7 benchmark Q5/Q6 (25/100 each).

---------

Co-authored-by: Millie <millie.macdonald@tiny.cloud>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants